package xdpm.nhom16.DAO;

import xdpm.nhom16.DTO.TenDiaDiemDTO;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class TenDiaDiemDAO extends AbstractDAO<TenDiaDiemDTO> {
	private static final String COLUMN_ID = "MaTenDiaDiem";
	private static final String[] NAME_COLUMNS = new String[] { COLUMN_ID, "TenDiaDiem" };
	public static final String TABLE_NAME = "TENDIADIEM";

	public TenDiaDiemDAO(SQLiteDatabase db) {
		super(db);
		// TODO Auto-generated constructor stub
	}

	@Override
	protected String getTableName() {
		// TODO Auto-generated method stub
		return TABLE_NAME;
	}

	@Override
	protected String getNameColumnId() {
		// TODO Auto-generated method stub
		return COLUMN_ID;
	}

	@Override
	protected String[] getNameColumns() {
		// TODO Auto-generated method stub
		return NAME_COLUMNS;
	}

	@Override
	protected TenDiaDiemDTO cusorToDTO(Cursor cursor) {
		// TODO Auto-generated method stub
		TenDiaDiemDTO result = new TenDiaDiemDTO();
		result.setMaTenDiaDiem(cursor.getInt(0));
		if (!cursor.isNull(1))
			result.setTenDiaDiem(cursor.getString(1));
		return result;
	}
}
